Skip to content

Conversation

@dependabot
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Nov 26, 2025

⚠️ Dependabot is rebasing this PR ⚠️

Rebasing might not happen immediately, so don't worry if this takes some time.

Note: if you make any changes to this PR yourself, they will take precedence over the rebase.


Bumps time-machine from 2.19.0 to 3.0.0.

Changelog

Sourced from time-machine's changelog.

3.0.0 (2025-11-18)

  • Remove mocking of time.monotonic() and time.monotonic_ns().

    This mocking caused too many issues, such as causing freezes in asyncio event loops (Issue [#387](https://github.com/adamchainz/time-machine/issues/387) <https://github.com/adamchainz/time-machine/issues/387>), preventing pytest-durations from timing tests correctly (Issue [#505](https://github.com/adamchainz/time-machine/issues/505) <https://github.com/adamchainz/time-machine/issues/505>), and triggering timeouts in psycopg (Issue [#509](https://github.com/adamchainz/time-machine/issues/509) <https://github.com/adamchainz/time-machine/issues/509>__). The root cause here is that mocking the monotonic clock breaks its contract, allowing it to move backwards when it’s meant to only move forwards.

    As an alternative, use |unittest.mock|__ to mock the monotonic function for the specific tested modules that need it. That means that your code should import monotonic() or monotonic_ns() directly, so that your tests can mock it in those places only. For example, if your system under test looks like:

    .. |unittest.mock| replace:: unittest.mock __ https://docs.python.org/3/library/unittest.mock.html

    .. code-block:: python

    # example.py
    from time import monotonic
    

    def measurement(): start = monotonic() ... end = monotonic() return end - start

    …then your tests can mock monotonic() like this:

    .. code-block:: python

    from unittest import TestCase, mock
    

    import example

    class MeasurementTests(TestCase): def test_success(self): with mock.patch.object(example, "monotonic", side_effect=[0.0, 1.23]): result = example.measurement() assert result == 1.23

    PR [#560](https://github.com/adamchainz/time-machine/issues/560) <https://github.com/adamchainz/time-machine/pull/560>__.

  • Parse str destinations with |datetime.fromisoformat()|__ first, before falling back to dateutil if installed. datetime.fromisoformat() can parse most valid ISO 8601 formats, with better performance and no extra dependencies.

    .. |datetime.fromisoformat()| replace:: datetime.fromisoformat() __ https://docs.python.org/3/library/datetime.html#datetime.datetime.fromisoformat

... (truncated)

Commits

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

Bumps [time-machine](https://github.com/adamchainz/time-machine) from 2.19.0 to 3.0.0.
- [Changelog](https://github.com/adamchainz/time-machine/blob/main/docs/changelog.rst)
- [Commits](adamchainz/time-machine@2.19.0...3.0.0)

---
updated-dependencies:
- dependency-name: time-machine
  dependency-version: 3.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
@dependabot dependabot bot added dependencies Pull requests that update a dependency file python:uv Pull requests that update python:uv code labels Nov 26, 2025
@malcolmbaig malcolmbaig merged commit ef2d843 into main Nov 26, 2025
60 checks passed
@malcolmbaig malcolmbaig deleted the dependabot/uv/time-machine-3.0.0 branch November 26, 2025 15:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file python:uv Pull requests that update python:uv code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant